              package com.java.diagnostics.visualizer.impl.data;
              
              import com.java.diagnostics.visualizer.data.TupleData;
              import java.util.ArrayList;
              import java.util.List;
              
              public class RepresentativeTupleDataImpl extends TupleDataImpl
              {
                private int length;
                private List<TupleData> tuples;
              
                public RepresentativeTupleDataImpl(TupleDataImpl baseData)
                {
                  super(baseData.getLabel(), baseData.getDisplayName(), baseData.getCategory(), 
                    baseData.getAxisPair());
                  this.tuples = new ArrayList();
                  this.tuples.add(baseData);
                  this.length = baseData.length();
                  super.setTupleMetaData(baseData.getTupleMetaData());
                }
              
                public double getRawMinX() {
                  double min = 1.7976931348623157E+308D;
                  for (TupleData tuple : this.tuples) {
                    min = Math.min(min, tuple.getRawMinX());
                  }
                  return min;
                }
              
                public double getRawMaxX() {
                  double max = -1.797693134862316D+308D;
                  for (TupleData tuple : this.tuples) {
                    max = Math.max(max, tuple.getRawMaxX());
                  }
                  return max;
                }
              
                public double getRawMinY() {
                  double min = 1.7976931348623157E+308D;
                  for (TupleData tuple : this.tuples) {
                    min = Math.min(min, tuple.getRawMinY());
                  }
                  return min;
                }
              
                public double getRawMaxY() {
                  double max = -1.797693134862316D+308D;
                  for (TupleData tuple : this.tuples) {
                    max = Math.max(max, tuple.getRawMaxY());
                  }
                  return max;
                }
              
                public double getMaxX(String units)
                {
                  double max = -1.797693134862316D+308D;
                  for (TupleData tuple : this.tuples) {
                    max = Math.max(max, tuple.getMaxX(units));
                  }
                  return max;
                }
              
                public double getMaxY(String units)
                {
                  double max = -1.797693134862316D+308D;
                  for (TupleData tuple : this.tuples) {
                    max = Math.max(max, tuple.getMaxY(units));
                  }
                  return max;
                }
              
                public double getMinX(String units)
                {
                  double min = 1.7976931348623157E+308D;
                  for (TupleData tuple : this.tuples) {
                    min = Math.min(min, tuple.getMinX(units));
                  }
                  return min;
                }
              
                public double getMinY(String units)
                {
                  double min = 1.7976931348623157E+308D;
                  for (TupleData tuple : this.tuples) {
                    min = Math.min(min, tuple.getMinY(units));
                  }
                  return min;
                }
              
                public final void mergeInData(TupleDataImpl tupleData)
                {
                  if (tupleData.isEmpty())
                  {
                    return;
                  }
                  this.tuples.add(tupleData);
              
                  if (tupleData.length() > length())
                    this.length = tupleData.length();
                }
              
                public int length()
                {
                  return this.length;
                }
              
                public boolean isEmpty()
                {
                  return this.length == 0;
                }
              }

